class UserDetails {
    static transients = ["pass"]
    static hasMany = [roles: Role]
    static belongsTo = Role

    String username
    String displayName
    String passwordHash
    boolean enabled
    String email
    boolean showEmail
    String description
    String salt = "[secret]"

    static def constraints = {
        username(blank: false, unique: true)
        displayName(blank: false)
        passwordHash(blank: false)
        enabled()
    }
}